package edu.sctu.zhuyingzhi.month201506.day20150618.awtTest;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

/**
 * Created by Administrator on 2015/6/17.
 */
public class CardLayout1 implements MouseListener {

    Frame frame = new Frame("CardLayout");
    CardLayout cardLayout = new CardLayout();
    Button button1;
    Button button2;
    Button button3;
    Label label;
    TextArea page3Area;

    public void gotoo() {
        frame.setLayout(cardLayout);

//        frame.add(button1 = new Button("1111"), "button1");
//        frame.add(label = new Label("lable"), "lable");
//
//        button1.addMouseListener(this);
//        label.addMouseListener(this);

        Panel panel = new Panel();
        panel.setLayout(new BorderLayout());


        panel.add(page3Area = new TextArea("text"), "Center");
        panel.add(button2 = new Button("button2"), "North");
        panel.add(button3 = new Button("button3"), "South");

        button2.addMouseListener(this);
        button3.addMouseListener(this);

        frame.add(panel, "panel");
        frame.setSize(300, 300);
        frame.setVisible(true);
    }


    @Override
    public void mouseClicked(MouseEvent e) {

        System.out.println("212121212");
    }

    @Override
    public void mousePressed(MouseEvent e) {

    }

    @Override
    public void mouseReleased(MouseEvent e) {

    }

    @Override
    public void mouseEntered(MouseEvent e) {

    }

    @Override
    public void mouseExited(MouseEvent e) {

    }
}

